package com.app.coffeephilosophy.itemview;

import com.app.coffeephilosophy.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

public class ImageItemViewActivity extends Activity {
	private ImageView imageView;
	private TextView  textname;
	private TextView  introduce;
	/*
	 * 1,fresh 2,warm 3,sad
	 */
	private int type;
	
	private int[] item_fresh = new int[] { R.drawable.kabuqinuo_big,
			R.drawable.lanshan_big, R.drawable.moka_big,
			R.drawable.kabuqinuo_big, R.drawable.kabuqinuo_big,
			R.drawable.kabuqinuo_big, R.drawable.kabuqinuo_big,
			R.drawable.kabuqinuo_big, };
	
	private int[] item_warm = new int[] { R.drawable.kabuqinuo_big,
			R.drawable.lanshan_big, R.drawable.moka_big,
			R.drawable.kabuqinuo_big, R.drawable.kabuqinuo_big,
			R.drawable.kabuqinuo_big, R.drawable.kabuqinuo_big,
			R.drawable.kabuqinuo_big, };
	
	private int[] item_sad = new int[] { R.drawable.kabuqinuo_big,
			R.drawable.lanshan_big, R.drawable.moka_big,
			R.drawable.kabuqinuo_big, R.drawable.kabuqinuo_big,
			R.drawable.kabuqinuo_big, R.drawable.kabuqinuo_big,
			R.drawable.kabuqinuo_big, };
	
	private String[] text_fresh=new String[]{"蓝山","摩卡","卡奇诺","拿铁",
			"蓝山","摩卡","卡奇诺","拿铁"};
	
	private String[] text_warm=new String[]{"蓝山","摩卡","卡奇诺","拿铁",
			"蓝山","摩卡","卡奇诺","拿铁"};
	
	private String[] text_sad=new String[]{"蓝山","摩卡","卡奇诺","拿铁",
			"蓝山","摩卡","卡奇诺","拿铁"};
	
	private String[] introduce_fresh=new String[]{"拥有独特的酸味和柑橘的清香气息，更为芳香迷人", 
			"甘醇中带有令人陶醉的丰润余味，独特的香气以及柔和的酸、甘味",
			"苦味与酸味很好的配合，在品尝时会有细致顺滑，清爽淡雅的感觉",
			"曼特宁咖啡香气浓郁、口感丰厚、味道强烈、略带有巧克力味和糖浆味。",
			"科纳咖啡具有一种兼有葡萄酒香、水果香和香料香的混合香味",					
			"具有浓烈而值得怀念的味道",
			"绝妙而强烈的风味冲击着你的整条舌头，风味既清新又不霸道。",
			"它风味俱全，无苦味，富含营养，果味浓郁。"};

	private String[] introduce_warm=new String[]{"拥有独特的酸味和柑橘的清香气息，更为芳香迷人", 
			"甘醇中带有令人陶醉的丰润余味，独特的香气以及柔和的酸、甘味",
			"苦味与酸味很好的配合，在品尝时会有细致顺滑，清爽淡雅的感觉",
			"曼特宁咖啡香气浓郁、口感丰厚、味道强烈、略带有巧克力味和糖浆味。",
			"科纳咖啡具有一种兼有葡萄酒香、水果香和香料香的混合香味",					
			"具有浓烈而值得怀念的味道",
			"绝妙而强烈的风味冲击着你的整条舌头，风味既清新又不霸道。",
			"它风味俱全，无苦味，富含营养，果味浓郁。"};
	
	private String[] introduce_sad=new String[]{"拥有独特的酸味和柑橘的清香气息，更为芳香迷人", 
			"甘醇中带有令人陶醉的丰润余味，独特的香气以及柔和的酸、甘味",
			"苦味与酸味很好的配合，在品尝时会有细致顺滑，清爽淡雅的感觉",
			"曼特宁咖啡香气浓郁、口感丰厚、味道强烈、略带有巧克力味和糖浆味。",
			"科纳咖啡具有一种兼有葡萄酒香、水果香和香料香的混合香味",					
			"具有浓烈而值得怀念的味道",
			"绝妙而强烈的风味冲击着你的整条舌头，风味既清新又不霸道。",
			"它风味俱全，无苦味，富含营养，果味浓郁。"};
	@Override
	public void onCreate(Bundle savedInstanceState) {
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		// 去除标题栏
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.imageitemview);
		imageView = (ImageView) findViewById(R.id.imageView);
		textname = (TextView)findViewById(R.id.textname);
        introduce =(TextView) findViewById(R.id.introduce);
		Intent intent = getIntent();
		int imageId = intent.getIntExtra("id", R.drawable.lanshan_big);
		type = intent.getIntExtra("type", 0);
		switch (type) {
		case 1:
			imageView.setImageResource(item_fresh[imageId]);
			textname.setText(text_fresh[imageId]);
	        introduce.setText(introduce_fresh[imageId]);
			break;
		case 2:
			imageView.setImageResource(item_warm[imageId]);
			textname.setText(text_warm[imageId]);
			introduce.setText(introduce_warm[imageId]);
			break;
		case 3:
			imageView.setImageResource(item_sad[imageId]);
			textname.setText(text_sad[imageId]);
			introduce.setText(introduce_sad[imageId]);
			break;
		}
	}
}
